package com.zecan.blog.controller.exception;

import com.zecan.blog.common.status.BlogCommonStatus;
import lombok.*;

/**
 * @ClassName BlogException
 * @Description
 * @date 2022/10/29 20:18
 * @Version 1.0
 * 所有异常类的父类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@EqualsAndHashCode
public class BlogException extends RuntimeException{
    int code;
    String msg;

    public BlogException(BlogCommonStatus status) {
        this.code = status.getCode();
        this.msg = status.getMsg();
    }
}
